<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body">
<div class="layui-tab layui-tab-brief" lay-filter="deploy_url">
    <ul class="layui-tab-title">
        <?php foreach(c('type.deploy_group') as $key => $v):?>
        <li class="<?php if($group_id==$key):?>layui-this<?php endif;?>">
            <a href="<?=url('deploy/group',['id'=>$key])?>"><?=$v?>配置</a>
        </li>
        <?php endforeach;?>
    </ul>
    <div class="layui-tab-content" style="padding-left: unset;">
        <div class="layui-tab-item layui-show">
            <div class="layui-row">
                <div class="layui-col-xs12 layui-col-md5">
                    <form action="<?=url('deploy/group',['id'=>$group_id])?>" method="post" class="layui-form">
                        <?php foreach($list as $key=>$v):?>
                        <div class="layui-form-item">
                            <label class="layui-form-label"><?=$v['title']?></label>
                                <div class="layui-input-block">
                                <?php switch($v['type']):
                                    case 1:?>
                                    <input type="text" name="<?=$v['name']?>" value="<?=$v['value']?>" class="layui-input">
                                    <?php break;?>
                                    <?php case 2:?>
                                    <textarea name="<?=$v['name']?>" class="layui-textarea" rows="4"><?=$v['value']?></textarea>
                                    <?php break;?>
                                    <?php case 3:?>
                                    <textarea name="<?=$v['name']?>" class="layui-textarea" rows="4"><?=$v['value']?></textarea>
                                    <?php break;?>
                                    <?php case 4:?>
                                    <select name="<?=$v['name']?>">
                                    <?php if(!empty($v['extra'])):?>
                                        <?php foreach(parse_config_attr($v['extra']) as $key => $vo):?>
                                            <option value="<?=$key?>" <?php if($v['value']==$key):?>selected<?php endif;?> ><?=$vo?></option>
                                        <?php endforeach;?>
                                    <?php endif;?>
                                    </select>
                                    <?php break;?>
                                    <?php case 5:?>
                                        <input type="number" name="<?=$v['name']?>" value="<?=$v['value']?>" class="layui-input">
                                    <?php break;?>
                                <?php endswitch;?>
                                <div class="layui-form-mid layui-word-aux"><?=$v['remark']?></div>
                            </div>
                        </div>
                    <?php endforeach;?>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="myform">立即提交</button>
                                <button class="layui-btn layui-btn-primary retreat">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
    layui.use(['jquery','element','form'], function () {
        layui.form.render('select');
        layui.element.on('tab(deploy_url)', function () {
            layui.layer.load(2);
            window.location.href = layui.$(this).children('a').attr('href');
        });
    });
</script>
